#include <cstring>
#include <cstdio>
using namespace std;

int num[500001] = {0};

void preCalc()
{
	for (int i = 2; i <= 250000; ++i)
	{
		for (int j = 2; i * j <= 500000; ++j)
		{
			num[i*j] += i;
		}
	}
	num[1] = -1;
}

int main()
{
	preCalc();
	
	int caseCount;
	scanf("%d", &caseCount);
	while (caseCount)
	{
		--caseCount;
		
		int n;
		scanf("%d", &n);
		
		printf("%d\n", num[n]+1);
	}
	
	return 0;
}
